<template>
	<view class="webstate" v-if="open_state">
		<u-parse :html="intro" />
	</view>
</template>

<script>
export default{
	data(){
		return {
			open_state: false,
			time: 3000,
			intro: '',
		}
	},
	mounted() {
		this._initData()
	},
	watch:{
		open_state(value,oldValue){
			if(value===true){
				setTimeout(()=>{
					this.open_state = false
				},this.time)
			}
		}
	},
	methods:{
		_initData(){
			this.$network("/api/index/defInfo",{type:'project_state'}).then(({data})=>{
				this.open_state = data.open_state === 1
				this.time = data.time || 3000
				this.intro = data.intro || '项目开发中~'
				
			}).catch(()=>{
			})
		},
	}
}
</script>

<style lang="scss">
	.webstate {
		position: fixed;
		top: 0;
		left: 0;
		z-index: 999999;
		width: 100%;
		height: 100%;
		background-color: rgba(255, 255, 255, 0.97);
		display: flex;
		align-items: center;
		justify-content: center;
		font-size: 38rpx;
		padding: 60rpx;
	}
</style>